﻿#include "Refactor3DDialog.h"

Refactor3DDialog::Refactor3DDialog(QWidget *parent)
	: QDialog(parent)
	, ui(new Ui::Refactor3DDialogClass())
{
	ui->setupUi(this);
}

Refactor3DDialog::~Refactor3DDialog()
{
	delete ui;
}


void Refactor3DDialog::updateSlider()
{
	m_heightList = PtrCoreData->getSortHeightList();
	int size = m_heightList.size();
	ui->horizontalSlider->setRange(1, size);
	ui->horizontalSlider->setTickInterval(1);
}

void Refactor3DDialog::shiftOpenglWidgetByHeight(int value)
{
	//int height = PtrCoreData->getHeightVector()[value - 1];
	//ui->openGLWidget->setVertexArray(PtrCoreData->getVec3DMap().value(height));
	int height = PtrCoreData->getSortHeightList()[value - 1];
	ui->openGLWidget->setVertexArray(PtrCoreData->getVec3DMap().value(height));
	ui->openGLWidget->update();
	ui->label->setText(QString::number(m_heightList[value - 1]));
}
